package com.shenyi.shop.service;

import com.shenyi.shop.api.IAddressService;
import com.shenyi.shop.dao.AddressMapper;
import com.shenyi.shop.entity.AddressDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author richard.fan
 * @version 1.0
 * @date 2018/11/05
 * @desc 地址
 * @see
 * @since 1.0
 */
@Service
public class AddressServiceImpl implements IAddressService {


    @Autowired
    private AddressMapper addressMapper;

    @Override
    public AddressDO queryObject(Integer id) {
        return addressMapper.queryObject(id);
    }

    @Override
    public List<AddressDO> queryList(Map<String, Object> map) {
        List<AddressDO> list = addressMapper.queryList(map);
//        if (null != list && list.size() > 0) {
//            for (AddressDO AddressDO : list) {
//                //翻译收货地址国家码
//
//            }
//        }
        return list;
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return addressMapper.queryTotal(map);
    }

    @Override
    public int save(AddressDO address) {
        return addressMapper.save(address);
    }

    @Override
    public int update(AddressDO address) {
        return addressMapper.update(address);
    }

    @Override
    public int delete(Integer id) {
        return addressMapper.delete(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return addressMapper.deleteBatch(ids);
    }
}
